﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HAMath;

namespace HA.Data
{

    [Serializable]
   public  class KrigingOption:ICloneable
    {
        public KrigingOption()
        { }

        KrigingType _krigType = KrigingType.Ordinary;

        public KrigingType KrigType
        {
            get { return _krigType; }
            set { _krigType = value; }
        }

        SearchEllipsoid _ellipsoid=new SearchEllipsoid ();

        public SearchEllipsoid Ellipsoid
        {
            get { return _ellipsoid; }
            set { _ellipsoid = value; }
        }


        SearchOption _searchOption=new SearchOption ();

        public SearchOption SearchOption
        {
            get { return _searchOption; }
            set { _searchOption = value; }
        }


        ModelVariogram _modelVariogram;
        /// <summary>
        /// 模型变差方程
        /// </summary>
        public ModelVariogram ModelVariogram
        {
            get { return _modelVariogram; }
            set { _modelVariogram = value; }
        }

        List<ExperimentalVariogram> _experimentVariogram = new List<ExperimentalVariogram>();
        /// <summary>
        /// 实验变差方程
        /// </summary>
        public List<ExperimentalVariogram> ExperimentVariogram
        {
            get { return _experimentVariogram; }
            set { _experimentVariogram = value; }
        }
       


        public object Clone()
        {
            KrigingOption obj = new KrigingOption();
            obj = (KrigingOption)this.MemberwiseClone();
            obj.Ellipsoid = new SearchEllipsoid();
            obj.Ellipsoid =(SearchEllipsoid) this.Ellipsoid.Clone();
            //obj.ExperimentVariogram = new ExperimentalVariogram(VariogramType.Semivariogram);
            //if (this.ExperimentVariogram != null)
            //{ 
            //    obj.ExperimentVariogram =(ExperimentalVariogram) this.ExperimentVariogram.Clone();
            //}
            obj.ExperimentVariogram = new List<ExperimentalVariogram>();
            obj.ExperimentVariogram.AddRange(this.ExperimentVariogram);
           
            obj.ModelVariogram = new ModelVariogram(HAMath.ModelType.Spherical, 33.35, 0.5, 50.0);
            if (this.ModelVariogram != null)
            {
                obj.ModelVariogram = (ModelVariogram)this.ModelVariogram.Clone();
            }
            obj.SearchOption = new SearchOption();
            obj.SearchOption =(SearchOption) this.SearchOption.Clone();
            return obj;
        }
    }
}
